package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2020-10-21
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_spell_info")
@ApiModel(value = "SpellInfo", description = "")
@AllArgsConstructor
public class SpellInfo extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "")
    @NotNull(message = "不能为空")
    @TableField("price_id")
    @Excel(name = "")
    private Long priceId;

    @ApiModelProperty(value = "")
    @Length(max = 100, message = "长度不能超过100")
    @TableField(value = "price_title", condition = LIKE)
    @Excel(name = "")
    private String priceTitle;

    /**
     * 批次号
     */
    @ApiModelProperty(value = "批次号")
    @Length(max = 50, message = "批次号长度不能超过50")
    @TableField(value = "order_num", condition = LIKE)
    @Excel(name = "批次号")
    private String orderNum;

    /**
     * 1待成团2拼团成功3拼团失败
     */
    @ApiModelProperty(value = "1待成团2拼团成功3拼团失败")
    @TableField("status")
    @Excel(name = "1待成团2拼团成功3拼团失败")
    private Integer status;

    @ApiModelProperty(value = "")
    @TableField("failure_count")
    @Excel(name = "")
    private Long failureCount;

    @ApiModelProperty(value = "")
    @TableField("success_count")
    @Excel(name = "")
    private Long successCount;

    /**
     * 奖励拼团值
     */
    @ApiModelProperty(value = "奖励拼团值")
    @TableField("spell_value")
    @Excel(name = "奖励拼团值")
    private Long spellValue;

    /**
     * 爱心值奖励
     */
    @ApiModelProperty(value = "爱心值奖励")
    @TableField("love_vlue")
    @Excel(name = "爱心值奖励")
    private Long loveVlue;

    /**
     * 贡献值
     */
    @ApiModelProperty(value = "贡献值")
    @TableField("contribution_value")
    @Excel(name = "贡献值")
    private Long contributionValue;

    /**
     * 分享
     */
    @ApiModelProperty(value = "分享")
    @TableField("share_value")
    @Excel(name = "分享")
    private Long shareValue;

    /**
     * 结算日期
     */
    @ApiModelProperty(value = "结算日期")
    @Length(max = 20, message = "结算日期长度不能超过20")
    @TableField(value = "sett_date", condition = LIKE)
    @Excel(name = "结算日期")
    private String settDate;

    @TableField("split_value")
    private Long splitValue;
    @TableField("small_value")
    private Long smallValue;
    @TableField("center_split_value")
    private Long centerSplitValue;
    @TableField("center_small_value")
    private Long centerSmallValue;



    @Builder
    public SpellInfo(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, 
                    Long priceId, String priceTitle, String orderNum, Integer status, Long failureCount, 
                    Long successCount, Long spellValue, Long loveVlue, Long contributionValue, Long shareValue, String settDate) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.priceId = priceId;
        this.priceTitle = priceTitle;
        this.orderNum = orderNum;
        this.status = status;
        this.failureCount = failureCount;
        this.successCount = successCount;
        this.spellValue = spellValue;
        this.loveVlue = loveVlue;
        this.contributionValue = contributionValue;
        this.shareValue = shareValue;
        this.settDate = settDate;
    }

}
